package com.tsmti.system.service.impl;

import com.tsmti.core.common.service.impl.BaseServiceImpl;
import com.tsmti.system.dao.SystemPageColumnDao;
import com.tsmti.system.dto.PageColDto;
import com.tsmti.system.entity.SystemPageColumn;
import com.tsmti.system.service.SystemPageColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Package：com.tsmti.system.service.impl
 * @Class：SystemPageColumnServiceImpl
 * @Description： TODO
 * @Author：zcw
 * @Date：Created in 2018/5/29 14:04
 * @Company:
 * @Version：
 * @Modified By:
 */
@Transactional(rollbackFor = Exception.class)
@Service("systemPageColumnService")
public class SystemPageColumnServiceImpl  extends BaseServiceImpl<SystemPageColumn> implements SystemPageColumnService {
    @Autowired
    @Qualifier(value = "systemPageColumnDao")
    private SystemPageColumnDao systemPageColumnDao;

    @Override
    public List<PageColDto> getUserDefaultColList(String pageId, String userName,boolean onlyUser) {
        return systemPageColumnDao.getUserDefaultColList(pageId,userName,onlyUser);
    }

    @Override
    public List<PageColDto> getSystemColList(String pageId) {
        return systemPageColumnDao.getSystemDefaultColList(pageId);
    }

    @Override
    public List<SystemPageColumn> findListById(String pageId, String colIds) {
        return findByHql(" from SystemPageColumn where   pageId=? and  id in ("+colIds+") order by orders",pageId);
    }
}
